﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Workbench.Core;
using SharedGenomics.Core;

namespace SharedGenomics.Workbench.Presenters
{
    public class Presenter : IPresenter
    {
        public Presenter(IView view)
        {
            this.View = view;
        }

        protected void RequestClose()
        {
            this.RequestingClose.Raise(this);
        }

        /// <summary>
        /// The default is to avoid snapshotting presenters in the viewed annotation stream.  Override this in subclasses that should be present in the stream.
        /// </summary>
        public virtual bool SnapshotOnOpen
        {
            get { return false; }
        }

        public IView View { get; private set; }
        public event EventHandler RequestingClose;

        [Microsoft.Practices.Unity.Dependency]
        public IBackgroundExecutor BackgroundExecutor { protected get; set; }

        [Microsoft.Practices.Unity.Dependency]
        public IEventBroker EventBroker { protected get; set; }
    }
}
